		**********************************************************
		** File: Figure_C15.do									**
		** Paper: Human Trafficking Indicators: A New Dataset	**
		** Author: Richard Frank								**
		** Date: July 11, 2021									**
		** Task: Creating Figure C15							**
 		**********************************************************

	clear
	version 15.1
	set seed 1234
	set scheme lean1
	graph set window fontface "Times New Roman"

	use "/Users/rich/Dropbox/Data/HT/HTI/HTI 00-17.dta"
	
	** SUMMARY STATISTICS FOR 2001-2016

	drop if ccode==-11
	drop if ccode==-22
	drop if ccode==-33
 
	sort year
	by year: egen totalcountries=count(ccode)
	label var totalcountries "Total # countries in given year"

 
***************
** Victim ID **
***************

**DICHOTOMIZING **

	gen viyesdich=.
	replace viyesdich =1 if victimid==1
	label var viyesdich "victimid= yes(dich)"

	gen vinodich=.
	replace vinodich =1 if victimid==-1	
	label var vinodich "victimid=no (dich)"

	gen vinomdich=.
	replace vinomdich =1 if victimid==0	
	label var vinomdich "victimid=no (dich)"


**TOTAL IN A YEAR **

	sort year
	by year: egen viyestot=count(viyesdich)
	label var viyestot "Total # victimid=yes in a year"

	sort year
	by year: egen vinotot=count(vinodich)
	label var vinotot "Total # victimid=no in a year"

	sort year
	by year: egen vinomtot=count(vinomdich)
	label var vinomtot "Total # victimid=no in a year"


**PERCENTAGE **

	gen viyespct=viyestot/totalcountries
	label var viyespct "Yes"

	gen vinopct=vinotot/totalcountries
	label var vinopct "No"
	
	gen vinompct=vinomtot/totalcountries
	label var vinompct "No Mention"


twoway (line viyespct year, sort) ///
 (line vinopct year, sort) ///
  (line vinompct year, sort), ///
 ytitle(% of countries in sample) title(Victims ID) ///
 legend(pos(6) cols(3))
graph save victimid.gph, replace

*******************
** Victim Punish **
*******************

**DICHOTOMIZING **

	gen vpyesdich=.
	replace vpyesdich =1 if victimpunish==1
	label var vpyesdich "victimpunish= yes(dich)"

	gen vpnodich=.
	replace vpnodich =1 if victimpunish==-1	
	label var vpnodich "victimpunish=no (dich)"

	gen vpnomdich=.
	replace vpnomdich =1 if victimpunish==0	
	label var vpnomdich "victimpunish=no men(dich)"
	
**TOTAL IN A YEAR **

	sort year
	by year: egen vpyestot=count(vpyesdich)
	label var vpyestot "Total # victimpunish=yes in a year"

	sort year
	by year: egen vpnotot=count(vpnodich)
	label var vpnotot "Total # victimpunish=no in a year"

	sort year
	by year: egen vpnomtot=count(vpnomdich)
	label var vpnomtot "Total # victimpunish=no men in a year"
**PERCENTAGE **

	gen vpyespct=vpyestot/totalcountries
	label var vpyespct "Yes"

	gen vpnopct=vpnotot/totalcountries
	label var vpnopct "No"

	gen vpnompct=vpnomtot/totalcountries
	label var vpnompct "No mentioni"
	
twoway (line vpyespct year, sort) ///
 (line vpnopct year, sort) ///
  (line vpnompct year, sort), ///
 ytitle(% of countries in sample) title(Victims Punished) ///
  legend(pos(6) cols(3))
graph save victimpunish.gph, replace


graph combine  victimid.gph victimpunish.gph

 
	
	
	
